structure UnixPath = UnixPath (OS.Path);
fun printString s = print ("\"" ^ String.toString s ^ "\"\n")
fun printPath { isAbs, vol, arcs } = print ("{ isAbs = " ^ Bool.toString isAbs ^ ", vol = \"" ^ String.toString vol ^ "\", arcs = [" ^ String.concatWith "," (List.map (fn s => "\"" ^ String.toString s ^ "\"") arcs) ^ "] }\n");
printPath (UnixPath.fromString "");
printPath (UnixPath.fromString "/");
printPath (UnixPath.fromString "//");
printPath (UnixPath.fromString "a");
printPath (UnixPath.fromString "/a");
printPath (UnixPath.fromString "//a");
printPath (UnixPath.fromString "a/");
printPath (UnixPath.fromString "a//");
printPath (UnixPath.fromString "a/b");
printString (UnixPath.toString { isAbs = false, vol = "", arcs = [] });
fun printDirFile { dir, file } = print ("{ dir = \"" ^ String.toString dir ^ "\", file = \"" ^ String.toString file ^ "\" }\n");
printDirFile (UnixPath.splitDirFile "");
printDirFile (UnixPath.splitDirFile ".");
printDirFile (UnixPath.splitDirFile "b");
printDirFile (UnixPath.splitDirFile "b/");
printDirFile (UnixPath.splitDirFile "a/b");
printDirFile (UnixPath.splitDirFile "/a");
fun printBaseExt { base, ext = NONE } = print ("{ base = \"" ^ String.toString base ^ "\", ext = NONE }\n")
  | printBaseExt { base, ext = SOME ext } = print ("{ base = \"" ^ String.toString base ^ "\", ext = SOME \"" ^ String.toString ext ^ "\" }\n");
printBaseExt (UnixPath.splitBaseExt "");
printBaseExt (UnixPath.splitBaseExt ".login");
printBaseExt (UnixPath.splitBaseExt "/.login");
printBaseExt (UnixPath.splitBaseExt "a");
printBaseExt (UnixPath.splitBaseExt "a.");
printBaseExt (UnixPath.splitBaseExt "a.b");
printBaseExt (UnixPath.splitBaseExt "a.b.c");
printBaseExt (UnixPath.splitBaseExt ".news/comp");
printString (UnixPath.mkRelative { path = "a/b", relativeTo = "/c/d" });
printString (UnixPath.mkRelative { path = "/", relativeTo = "/a/b/c" });
printString (UnixPath.mkRelative { path = "/a/b/", relativeTo = "/a/c" });
printString (UnixPath.mkRelative { path = "/a/b", relativeTo = "/a/c" });
printString (UnixPath.mkRelative { path = "/a/b/", relativeTo = "/a/c/" });
printString (UnixPath.mkRelative { path = "/a/b", relativeTo = "/a/c/" });
printString (UnixPath.mkRelative { path = "/", relativeTo = "/" });
printString (UnixPath.mkRelative { path = "/", relativeTo = "/." });
printString (UnixPath.mkRelative { path = "/", relativeTo = "/.." });
printString (UnixPath.mkRelative { path = "/a/b/../c", relativeTo = "/a/d" });
printString (UnixPath.mkRelative { path = "/a/b", relativeTo = "/c/d" });
printString (UnixPath.mkRelative { path = "/c/a/b", relativeTo = "/c/d" });
printString (UnixPath.mkRelative { path = "/c/d/a/b", relativeTo = "/c/d" });
printString (UnixPath.getParent "/");
printString (UnixPath.getParent "a");
printString (UnixPath.getParent "a/");
printString (UnixPath.getParent "a///");
printString (UnixPath.getParent "a/b");
printString (UnixPath.getParent "a/b/");
printString (UnixPath.getParent "..");
printString (UnixPath.getParent ".");
printString (UnixPath.getParent "");
printString (UnixPath.getParent "///");
